<template>
  <div class="login" type="flex">
    <div class="masterInfo">
      <div class="title">管理后台</div>
      <div class="input">
        <el-input v-model="login.m_id"></el-input>
      </div>
      <div class="input">
        <el-input v-model="login.m_pwd" show-password></el-input>
      </div>
      <div class="pwd">
        <el-link @click="forgetpwd">忘记密码?</el-link>
      </div>
      <div class="button">
        <el-button type="primary" size="medium" @click="onlogin">登录</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "login",
  data() {
    return {
      login: {
        m_id: "",
        m_pwd: ""
      }
    };
  },
  methods: {
    onlogin() {
      if (this.login.m_id == null || this.login.m_id.length == 0) {
        this.$message.error("账号未填写!");
        return;
      }
      if (this.login.m_pwd == null || this.login.m_pwd.length == 0) {
        this.$message.error("密码未填写!");
        return;
      }
      this.$router.push("/home"); //路由跳转(编程式跳转)
    },
    forgetpwd() {
      //跳转至忘记密码页面
      this.$router.push("/home");
    }
  },
  mounted() {}
};
</script>

<style scoped>
.login {
  height: 100%;
  margin: 0px;
  padding: 0px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: white;
}
.title {
  padding: 50px 0px 50px;
  font-size: 80px;
  font-weight: bold;
  color: #027eaf;
  text-shadow: #aabbff;
}
.masterInfo {
  width: 1000px;
  background-color: #85dfc1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px 0 10px;
  border-radius: 24px;
}
.input {
  width: 400px;
  padding: 5px 0px 5px 0px;
}
.button {
  font-size: 20px;
}
.pwd {
  padding: 10px 0px 10px 0;
  font-size: 18px;
}
</style>